#ifndef _TEXT_NUMBER_RENDERER_H_
#define _TEXT_NUMBER_RENDERER_H_

#include <wx/dataview.h>

class wxDataViewNumberTextRenderer : public wxDataViewCustomRenderer, public wxEvtHandler
{
public:
  wxDataViewNumberTextRenderer(wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
                         int align = wxDVR_DEFAULT_ALIGNMENT);

  bool SetValue(const wxVariant& value);
  bool GetValue(wxVariant& value) const;

  bool Render(wxRect cell, wxDC* dc, int state);
  wxSize GetSize() const;

  // in-place editing
  virtual bool HasEditorCtrl() const;
  virtual wxControl* CreateEditorCtrl(wxWindow* parent, wxRect labelRect,
                                       const wxVariant& value);
  virtual bool GetValueFromEditorCtrl(wxControl* editor, wxVariant& value);

  void OnCharProcessed(wxKeyEvent& event);

protected:
  double StoredValue;

protected:
  DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewNumberTextRenderer)
  DECLARE_EVENT_TABLE()
};

#endif // _TEXT_NUMBER_RENDERER_H_
